Fixed index out of bound