         }()
         let imagePicker = UIImagePickerController()
         
+        print("TEST!@#")
+        
         if UIImagePickerController.isSourceTypeAvailable(.photoLibrary) &&
             (UIImagePickerController.availableMediaTypes(for: .photoLibrary)?.contains(type) ?? false) {
             imagePicker.mediaTypes = [type]

        alertVC.addAction(takePhotoAction)
        
        let chooseExistingPhotoAction = UIAlertAction(title: "Choose existing photo", style: .default) { _ in
            _ = Camera.shouldStartPhotoLibrary(target: self, mediaType: .Photo, canEdit: true)
        }
        alertVC.addAction(chooseExistingPhotoAction)
        

    
    // method to send the message to Parse
    private func sendMessage(text: String, video: URL?, picture: UIImage?) {
        var modifiedText = text
        var pictureFile: PFFile?
        
        print("Test")
        
        if let picture = picture,
            let data = UIImageJPEGRepresentation(picture, 0.6),
            let file = PFFile(name: "picture.jpg", data: data) {
            
            modifiedText += "[Picture message]"
            pictureFile = file
            file.saveInBackground { succeed, error in
                
                if succeed {
                    print ("This worked")
                } else {
                    print (error?.localizedDescription ?? "error")
                }
            }
        }
        
        // creates the messageObject
        if PFUser.current() != nil {
