Fixed problem with deprecated function