         popoverController.sourceView = userNameTextField
         popoverController.sourceRect = userNameTextField.bounds
         
-
         //Popover above the textfield
         popoverController.permittedArrowDirections = .Down
-
-        //Set the delegate
         popoverController.delegate = self
       }
       
       //Show the popover
       presentViewController(popoverVC!, animated: true, completion: nil)
 
-    }
-
-      //Check if password is empty
-
-    else if(passwordTextField.text == ""){
+    }else if(passwordTextField.text == nil || passwordTextField.text!.isEmpty){
 
       //if empty change password textfield border color to red
       passwordTextField.layer.borderColor = UIColor.redColor().CGColor
       passwordTextField.layer.borderWidth = 1.0
 
-
-      //Create popover controller
       let popoverVC = storyboard?.instantiateViewControllerWithIdentifier("loginPopover")
-
-      //Set it as popover
       popoverVC!.modalPresentationStyle = .Popover
-
-      //Set the size
       popoverVC?.preferredContentSize = CGSizeMake(250, 50)
 
       if let popoverController = popoverVC!.popoverPresentationController {

    
  }
  
  
  
  //Register a new acoount action
  @IBAction func registerNewAccountTapped(sender: AnyObject) {
  }
  
  
  //Forgot password action
  @IBAction func forgotPasswordTapped(sender: AnyObject) {
  }
  
  
  
  //Dismissing the keyboard
  @IBAction func dismissKeyboard(sender: AnyObject) {
    


        //Popover above the textfield
        popoverController.permittedArrowDirections = .Down
        popoverController.delegate = self

        //Show the popover
