additionaly save maxIndex when saving dimensions