Fix Bug of upgrade.