fixing upgrade script