add flushWrites function