fixed a bug that broke getting distinct values