changing depraciated code