Changed deprecated method to use new method