fix incorrect index