Update the middleware