     func applicationWillTerminate(application: UIApplication!) {
         // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
         // Saves changes in the application's managed object context before the application terminates.
-        /*
+        
         var data:CoreDataHelper = CoreDataHelper()
         var backgrounder:HTTPBackground = HTTPBackground()
         self.completionHandler = {}

                    println("Set unknown user state to 1")
                    data.setUserStatus("1")
                }else{
                    /*
                    self.inBounds++
                    if self.inBounds > 20 {
                        if !isIn {
                            isIn=true
                            let state: String = CoreDataHelper().getUserStatus()
                            if state == "0" || state == "-2" || state == "1" {
                                message = "Setting new state"
                                //self.setUserState("1")
                            }
                        }
                        self.inBounds = 0
                    }
                    */
                }
            
                if(nearestBeacon.proximity == lastProximity ||

        println("username: \(data.getUsername())")
        
        
        sendLocalNotificationWithMessage("You've quit RevCheckIn, \(data.getUsername()). this makes your account inactive!")
        println("SENDING TERMINATION STATE")
        data.setUserStatus("-1")
        
        self.saveContext()
    }

