fixed a bug with the WHERE logic that was looking for the operator type vs. string and fixed a bug in the distinct method