added error handling for worker