             textField.text = nil
             createNewButtons()
         }
-        else if oldValue?.showsPlaceholder != state?.showsPlaceholder {
-            updateButtonStates()
-        }
-        else if oldValue?.completedBorderColor != state?.completedBorderColor {
+        else if oldValue?.showsPlaceholder != state?.showsPlaceholder ||
+            oldValue?.focusBorderColor != state?.focusBorderColor ||
+            oldValue?.inactiveBorderColor != state?.inactiveBorderColor ||
+            oldValue?.completedBorderColor != state?.completedBorderColor ||
+            oldValue?.errorBorderColor != state?.errorBorderColor {
             updateButtonStates()
         }
     }

                newCharacter != "" {
                button.setTitle(newCharacter, for: .normal)
                button.setTitleColor(.black, for: .normal)
                button.layer.borderColor = (state?.completedBorderColor ?? .lightGray).cgColor
            }
            else {
                button.setTitle(showsPlaceholder ? state?.pin?.uppercased()[i] : nil, for: .normal)

                
                let isFocussed = isFirstResponder && i == textField.text?.characters.count ?? 0
                if isFocussed {
                    button.layer.borderColor = (overrideFocusBorderColor ?? state?.focusBorderColor)?.cgColor
                }
                else {
                    button.layer.borderColor = (overrideInactiveBorderColor ?? state?.inactiveBorderColor)?.cgColor
                }
            }
        }
