check if the pid exists or not