Fixing depreciated calls