updated ensureCorrectDimension to hopefully fix interpolation bug