Fixing issue with data sanitization

Fixing issue where if the job failed the data was not properly sanitized and escaped.