Fixed the middlewares