Added API check to replace a deprecated method