fix unique indices