fix permutations duplicates