                 pfcalendar.localEntity = String( calendar.calendarIdentifier )
                 
                 pfcalendar.saveInBackgroundWithBlock({ (saved, savingError) -> Void in
-                    user.inUseCalendarId = pfcalendar.objectId
-                    user.saveInBackground()
+                    self.setInUserCalendarForUser(user, calendarId: pfcalendar.objectId!)
                 })
             }
         }
+
+    }
+    
+    func setCalendar(calendar: EKCalendar) {
+        setInUserCalendarForCurrentUserAsync(calendar)
         
         self.calendar = calendar
     }

            if let remoteCalendar = rcalendar {
                print("Calendar Found")
                
                user.inUseCalendarId = remoteCalendar.objectId
                user.saveInBackground()
            }
            else {
                let pfcalendar = Calendar()

        return events
    }
    
    private func setInUserCalendarForUser(user: User, calendarId: String) {
        user.inUseCalendarId = calendarId
        user.saveInBackground()
    }
    
    private func setInUserCalendarForCurrentUserAsync(calendar: EKCalendar) {
        
        let user = PFUser.currentUser() as! User
        let query = PFQuery(className: Calendar.parseClassName())
        
