modified uniqueness test to fix NoneType error