fixing upgrade script.