Jeremy Newman : fix depreciated code