Fixed bug initiating current index