Modified to add more logging information for job failures