Insert waitpid() in main()