fix error_handler