Adding an error handler callback