Created the error handler