modify the error handler