fix n+1 for variants index action
Closes #5722