Added catch-all error handler