waitpid until exit