fix flush to disk creteria