solve bug where sometimes data is lost during file creation