added error handler to production