Fix deprecation warning with scoped