Fixed warning for deprecated method usage.