Fixed index error