Added some simple error checking for record not found errors when loading a page. Does not do error checking on any other logic however