fixing queries in q6