when writing file, avoid appending as well.