fix error handlers