fix error check. closes #1
Release 0.0.5
Automatically rewritten for npm.