Use file.append to write