                 print("New active member: \(username)")
                 self.inactiveMembers.removeValue(forKey: uid)
                 self.activeMembers[uid] = username
+                
+                // Ask database manager for user's notification id and adds it to local dictionary
+                DatabaseController.notificationIDForUser(with: uid, completion: { notificationID in
+                    if let id = notificationID { self.notificationIDs[username] = id }
+                })
             }
-            
-            // Ask database manager for the *current* notification ID of every observed member
-            DatabaseController.notificationIDForUser(with: uid, completion: { notificationID in
-                
-                if let id = notificationID {
-                    
-                    // Add to local copy, but write it back to database as well
-                    self.notificationIDs.append(id)
-                }
-            })
         })
         
     

                print("New inactive member: \(username)")
                self.activeMembers.removeValue(forKey: uid)
                self.inactiveMembers[uid] = username
            }
        })
    }

            let uid = snapshot.key
            if (uid == UserState.currentUser.uid) { return }
            
            // Unwrap username and remove
            if let username = snapshot.value as? String { self.notificationIDs.removeValue(forKey: username) }
        })
        
        
