             otherPasswordField?.isValid = nil
         }
         if validationMode == .confirmPassword {
-            if validationMode.validate(textField.text!, passToConfirm: otherPasswordField?.text) == true {
+            if validationMode.validate(textField.text!,
+                                       passToConfirm: otherPasswordField?.text,
+                                       minimumPasswordLength: minimumPasswordLength) == true {
                 _ = textFieldShouldReturn(textField)
             } else {
                 isValid = nil

    
    case name = 0,email,password,confirmPassword
    
    func validate(_ text: String, passToConfirm: String?) -> Bool? {
        if text == "" {
            return nil
        }

    }
    
    func textFieldDidEndEditing(_ textField: UITextField) {
        isValid = validationMode.validate(textField.text!,
                                          passToConfirm: otherPasswordField?.text,
                                          minimumPasswordLength: minimumPasswordLength)
    }
   
}
