refactor error pages to do the monitoring in the controller instead of the view