Fix deprecated method call