Check has_children before accessing children