added restrictions for duplicate values