Fixed bug with uniqueness