upgrade script fix