fix for distinct count