completed part1...detects SIGCHLD properly