                 }
             }
             else{
-                self.signUpButton.hidden = false;
-                self.activity.hidden = true;
-                self.privacyPolicyButton.hidden = false;
-                self.termsOfServiceButton.hidden = false;
+                self.toggleMenu(true);
             }
         }
     }

        }
        else if (textField == lastName){
            lastName.resignFirstResponder();
        }
        return true;
    }

    @IBAction func termsOfService(){
        UIApplication.sharedApplication().openURL(NSURL(string: "https://app.tndata.org/terms/")!);
    }
    
    private func toggleMenu(showButtons: Bool){
        dispatch_async(dispatch_get_main_queue(), {
            self.signUpButton.hidden = !showButtons;
            self.activity.hidden = showButtons;
            self.privacyPolicyButton.hidden = !showButtons;
            self.termsOfServiceButton.hidden = !showButtons;
        });
    }
}
