             return results
         }
     }
+    
+    func getTotalGeoNotifications() -> Int {
+        let (resultSet, err) = SD.executeQuery("SELECT * FROM GeoNotifications")
+        return resultSet.count
+    }
 
     func remove(id: String) {
         let err = SD.executeChange("DELETE FROM GeoNotifications WHERE Id = ?", withArgs: [id])

        notification.alertBody = geo["notification"]["text"].asString!
        UIApplication.sharedApplication().scheduleLocalNotification(notification)
    }
    
    // added custom
    
    func post(params : Dictionary<String, String>, url : String) {

        region.notifyOnExit = geoNotification["transitionType"].asInt == 2 ? true: false
        //store
        store.addOrUpdate(geoNotification)
        if(store.getTotalGeoNotifications() <= 20) {
            locationManager.startMonitoringForRegion(region)
        } else {
            // added for monitoring more than 20
            locationManager.startMonitoringSignificantLocationChanges()
            //log("location added to DB but not monitered only 20 can be monitered at a time")
        }
    }

    func getWatchedGeoNotifications() -> [JSON]? {
