redirect to error template if there is an error whlie rendering the view