adding flush to upgrade