waitpid is used instead of pth_waitpid