fixing FindCandIndex