Fixed the flushing streategy