added some feedback and error handling
added more error handling