Fixed query build process in get_child_items