Upgrade script updated