add middlewares(and update it)