Making queries, possible invalid tree building