Fix call to deprecated method