fixed index error.