fix error handling
fixes