fix for upgrade script