Fix indexNotDefined