upgraded upgrade script