fixed flush checking