fix missing array index