 
 extension TTSegmentedControl {
     
-    open var currentIndex: Int {
-        if !isConfigurated {
-            return 0
-        }
-        let label = labelForPoint(thumbContainerView.center)
-        let index = allItemLabels.firstIndex(of: label)
-        return index ?? 0
-    }
-    
     public func selectItemAt(index: Int, animated: Bool = false) {
-        if !isConfigurated {
-            currentSelectedIndex = index
-            return
-        }
-        let label = allItemLabels[min(index, attributedDefaultTitles.count - 1)]
+        guard (index >= 0 && index < itemTitles.count) else {
+            print("[TTSegmentedControl]: Index \(index) is out of range.")
+            return
+        }
+        
+        _currentIndex = index
+        
+        guard isConfigurated else {
+            return
+        }
+        
+        let label = allItemLabels[index]
         selectedLabelsView.isHidden = noItemSelected
         changeThumbFrameForPoint(label.center, animated: animated)
     }

    fileprivate var allowToChangeThumb = false
    fileprivate var allowMove = true
    fileprivate var selectInitialItem = 0
    fileprivate var currentSelectedIndex = 0
    
    open var noItemSelected:Bool = false {
        didSet {            

        updateFrameForLables(allSelectedItemLabels)
        updateSelectedViewFrame()
        
        selectItemAt(index: _currentIndex)
        _ = self.subviews.map({$0.isExclusiveTouch = true})
        
    }
