Call flush after every write