add error handling
Merge pull request #1 from zjjott/master

add error handling