change the logic of can_upgrade