ensure pid exists