fix deprecated method warning