Fixed file formatting when saving to txt

Fixed bug that tried to read previous data from deleted txt file