fix the problem with missng terms in collection
fix inner query to lower