Updated Upgrading logic.