featureIndex write error fixed, checked full script in ipdb