collecting pids in selectedIndexes to easily control what’s being selected