Eliminated a warning about deprecated method