Added in logging and trapping of job failure