[minor] call the middleware in scope of the provider