missed error check
Merge pull request #13 from nikhan/master

missed error check