improve error handling
added comments