things got complicated. needed to add recursion to query validator