changed middlewares signature to 3 params as 4 params is now for errors middlewares