Corrected working on corrupted files