     func setupProfileImageView() {
         //need x, y, width, height constraings
         profileImageView.centerXAnchor.constraintEqualToAnchor(view.centerXAnchor).active = true
-        profileImageView.bottomAnchor.constraintEqualToAnchor(inputContainerView.topAnchor, constant: -12).active = true
+        profileImageView.bottomAnchor.constraintEqualToAnchor(loginRegisterSegmentedControl.topAnchor, constant: -12).active = true
         profileImageView.widthAnchor.constraintEqualToConstant(150).active = true
         profileImageView.heightAnchor.constraintEqualToConstant(150).active = true
     }
 
+    func setupLoginRegisterSegmentedControl() {
+        //need x, y, width, height constraings
+        loginRegisterSegmentedControl.centerXAnchor.constraintEqualToAnchor(view.centerXAnchor).active = true
+        loginRegisterSegmentedControl.bottomAnchor.constraintEqualToAnchor(inputContainerView.topAnchor, constant: -12).active = true
+        loginRegisterSegmentedControl.widthAnchor.constraintEqualToAnchor(inputContainerView.widthAnchor).active = true
+        loginRegisterSegmentedControl.heightAnchor.constraintEqualToConstant(30).active = true
+    }
     func handleRegister() {
         guard let email = emailTextField.text where email != "", let password = passwordTextField.text where password != "", let name = nameTextField.text where name != "" else {
-            print("invalid email/pw")
-            return
+            return errorAlertWithMessage("Invalid Field", message: "Please enter valid Email/Password")
         }
 
         FIRAuth.auth()?.createUserWithEmail(email, password: password, completion: { (user, error) in

        return imageView
    }()

    override func viewDidLoad() {
        super.viewDidLoad()
        view.backgroundColor = UIColor(r: 61, g: 91, b: 151)
        view.addSubview(inputContainerView)
        view.addSubview(loginRegisterButton)
        view.addSubview(profileImageView)

        setupInputContainerView()
        setupLoginRegisterButton()
        setupProfileImageView()
    }

    func setupInputContainerView() {

                    print("save login erro = \(err)")
                    return
                }
                self.emailTextField.resignFirstResponder()
                self.nameTextField.resignFirstResponder()
                self.passwordTextField.resignFirstResponder()
                self.dismissViewControllerAnimated(true, completion: nil)
            })

        })
    }
    private func errorAlertWithMessage(title: String, message: String) {
        let alert = UIAlertController(title: title, message: message, preferredStyle: .Alert)
        let ok = UIAlertAction(title: "Ok", style: .Cancel, handler: nil)
        alert.addAction(ok)
        presentViewController(alert, animated: true, completion: nil)
    }
    override func preferredStatusBarStyle() -> UIStatusBarStyle {
        return .LightContent
    }
