improve error handling - fixes #3
0.2.1