correct index error