Deleted duplicate code for uniqueness check