Fixed context problem with upgrades