Replacing deprecated function call.