 
     func onUnregister() {
         self.events = []
-
-        currentUser!.getParticipatingEvents(userEventType: .Upcoming) { (upcomingEvents) in
-            print(upcomingEvents)
-            self.events.append(upcomingEvents)
-            self.tableView.reloadData()
-        }
-        
-        currentUser!.getParticipatingEvents(userEventType: .Past) { (pastEvents) in
-            print(pastEvents)
-            self.events.append(pastEvents)
-            self.tableView.reloadData()
-        }
+        updateEventsForCurrentUser()
     }
 
     // MARK: - Navigation

        // Pass the selected object to the new view controller.
    }


}

            }
            profileTags.text = tagText
            
            updateEventsForCurrentUser()
        }
    }
    
