not the source of the error, but fix error handling #3773