Deprecation warning fix