Fixed index problem from previous edit