actually check that pids are valid, updated docs