move the pid_is_valid output to its caller