updated upgrade script