Fix where query.