Fix flush issue