Fix deprecated method