Moved the app.router above the error handler.