use DISTINCT instead of count