added redirection middlewares