replaced deprecated function call