adjust minIndex