update variable reference to name, not index