switched to waitpid