Refix upgrade erase bug