made uniqueness validator work with objects of any type