       //Show the popover
       presentViewController(popoverVC!, animated: true, completion: nil)
       
-    }
-      
-      //then password check
-    else if (passwordTextField.text!.characters.count < 8) {
+    }else if (passwordTextField.text == nil || passwordTextField.text!.isEmpty) {
       
       passwordTextField.layer.borderColor = UIColor.redColor().CGColor
       passwordTextField.layer.borderWidth = 1

    
    
    //Name check
    if (nameTextField.text!.isEmpty){
      
      nameTextField.layer.borderColor = UIColor.redColor().CGColor
      nameTextField.layer.borderWidth = 1

    
  }
  
}
