flush after writing