add more error handling, fix messages
Merge pull request #2 from longaccess/master

add more error handling, fix messages