better error handling for job processing