see helper suggestion above for getting current index.