Use $index instead of index.