improve error handling
0.3.5