some fixes for duplicates