Added checking for uniqueness.