fix error handling
4.0.2