fixing batchUpdate(undefined index of array)