fixed flush issue