updating custom error handler