fixed incorrect index