Actually assign correct index

If the new index is zero (first tab) then the condition will always fall back to this.index.