How can I have a device function for all players of a team in verse

Basically, we want to hide a popup device for all players of a team when someone on that team presses a button on the popup. I know we could do this by duplicating the popup device and have the team index set to whatever team, but we want to do it all with just one popup device. We have this code here, but theres an error because there isn’t the proper type of agent to call for the device. How can I achieve this?
Screenshot 2025-05-06 151920

Adding another for loop, under the first for loop like this got it to work:
Screenshot 2025-05-07 181926