fix txt file cleanup bug