fix multiple flushed for file