added some navigation and minor error handling