Added global error handler.