Apply middlewares
Change from middleware to before