Added an error handler function.