patch context issue in serverMiddleware