Fixed a warning caused by the deprecated method.