fixed index out range.