Deprecation warning fixed