replaced deprecated function calls