fixed bug with transforming duplicates