take tree_id into account when creating the query to fetch children