fixed termination of children when exiting