corrected error handling
v0.8.1