Replaced use of a deprecated method with that of a new method.