Fix deprecated function call