fix to upgrade.sh