Only writes to file if isCorrupt.