             
         })
         
+        NotificationCenter.default.addObserver(forName: NSNotification.Name(rawValue: "MomentCreated"), object: nil, queue: OperationQueue.main, using: {(Notification) -> () in
+            //TODO: go to user profile screen to show newly added actions.
+            
+            self.user = User.currentUser
+            self.loadViewForSelectedMode()
+            
+        })
 
         if userId != nil {
             FireBaseManager.shared.fetchMomentsForUser (startAtMomentId: nil, userId: userId!, completion: { (moments: [Moment]?, error: Error?) in

            if let dictionary = self.userProfileManager?.actionsAndMomentsDataSource?[section] {
                let key = Array(dictionary.keys)
                if let momentsArray = dictionary[key[0]] {
                    return momentsArray.count+1
                }
            }
        }
        
        return 1
    }
    
    func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {

                }
            }
        }
    }
    
    
    func numberOfSections(in tableView: UITableView) -> Int {
        if let useractions = self.user?.actions {
            return useractions.count
        } else if self.user?.id == User.currentUser?.id { //allow adding actions for logged user
            return 1
        }
        return 0
    }
    
    func tableView(_ tableView: UITableView, titleForHeaderInSection section: Int) -> String? {
