replaced uniq with select