                 email: self.newEmail.text!,
                 trackID: self.newTrackID.text!,
                 photo: imageData)
+            sendProfileToDB(trackID: self.newTrackID.text!)
             self.navigationController?.popToRootViewControllerAnimated(true)
         }
     }

        
        imagePicker.delegate = self
        
        NSNotificationCenter.defaultCenter().addObserver(self, selector: #selector(keyboardWillShow), name: UIKeyboardWillShowNotification, object: nil)
        NSNotificationCenter.defaultCenter().addObserver(self, selector: #selector(keyboardWillHide), name: UIKeyboardWillHideNotification, object: nil)
        
    }
    
    func keyboardWillShow(notification: NSNotification) {

            alert.addAction(alertAction)
        }
    }
    
    func sendProfileToDB(trackID trackID: String) {
        let databaseChildPath = "user_contacts/\(AppState.sharedInstance.UUID)"
        let data = [trackID : true]
        self.ref.child(databaseChildPath).updateChildValues(data)
        print("Profile sent to DB")
    }
}
