fix permutation