factor out the parent pid checking from child process