         
         guard selectionStyle == .check else { return }
         
-        guard indexPath.item == indexOfSelectedColor else {
+        guard indexPath.item == indexSelectedColor else {
             colorPickerCell.checkbox.setCheckState(.unchecked, animated: false)
             return
         }

    open var selectionStyle: ColorPickerViewSelectStyle = .check
    
    // MARK: - Private properties
    fileprivate var indexOfSelectedColor: Int?
    fileprivate lazy var collectionView: UICollectionView = {
        
        let layout = UICollectionViewFlowLayout()

                print("ERROR ColorPickerView - preselectedItem out of colors range")
                return
            }
            indexSelectedColor = preselectedIndex
            
            collectionView.selectItem(at: IndexPath(item: indexSelectedColor!, section: 0), animated: false, scrollPosition: .centeredHorizontally)
        }
    }
    /// If true, the selected color can be deselected by a tap
