fixed index error