writing simulator flushes buffer