fixed handling of child elements