clean up error handler