changed upgrade script