Correct shutdown of children