moved middleware to allow res.view from body parser error middleware