why flush before write, rather than after?