corrected two typos in file overwriting