fix bad indeices