handling duplicates