implemented code to collect the exit children.