fix portals scripts