Fixed deprecated method warning