fixed undefined index: 'children'