                     for snap in snapshot.children {
                         let userSnap = snap as! DataSnapshot
                         let uid = userSnap.key //the uid of each user
-                         print("key = \(uid)")
+                        print("key = \(uid)")
+                        
                         Database.database().reference().child("users").child(uid).child("messages").childByAutoId().setValue(message)
-                        
-                        
-                        
+                    
                     }
                     
                     

                        //yes we got the user
                        let user = snapshot
                        print("\(user)  exists" )
                        return
                    }
                    

                    //no there is no user with desired email
                    print("\(userEmail) isn't a user")
                    self.displayAlertMessage(userMessage: "User doesn't exist")
                    
                    
                    
                })
                { (error) in
                    print("Failed to get snapshot", error.localizedDescription)

                }
                


            }
        })
