fixed inheritence of query_tree