added isDuplicate method