added code to check_job_fail - mitch