Added validation of duplicates