get valid pids method