fix bug for segmented control index