Make sending $index depend on arity of block