Fixed bug with route middlewares