reinstate part of the middleware