added some code to view error handling, added nesting to pages