Update to write to files in tmp directory for creating reports