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

        popoverController.sourceView = confirmPasswordTextField
        popoverController.sourceRect = confirmPasswordTextField.bounds
        
        
        //Popover above the textfield
        popoverController.permittedArrowDirections = .Down
        
        //Set the delegate
        popoverController.delegate = self
      }
      

      presentViewController(popoverVC!, animated: true, completion: nil)
      
      
    }else if passwordTextField.text! != confirmPasswordTextField.text! {
      
      let popoverVC = storyboard?.instantiateViewControllerWithIdentifier("confirmPopover")
      popoverVC!.modalPresentationStyle = .Popover
      popoverVC!.preferredContentSize = CGSizeMake(250, 55)
      
      if let popoverController = popoverVC!.popoverPresentationController {
