Fix deprecated method usage