find scope by pid, not by name, avoids problems

Scope may exist by name even if the pid wasn't successfully added to it.