flush when writing content