update script so it works with the new version of the portal