             tableView.scrollEnabled = true
         } else {
             var pparties = [[Party]]()
-            for p in parties {
+            for p in PartiesManager.sharedInstance.parties {
                 let filteredP = p.filter({ $0.isGoing })
                 if filteredP.count > 0 {
                     pparties.append(filteredP)


    @IBAction func updateSegment(sender: UISegmentedControl) {
        reloadData()
        let userDefaults = NSUserDefaults.standardUserDefaults()
        userDefaults.setInteger(sender.selectedSegmentIndex, forKey: "selectedSegmentIndex")
        userDefaults.synchronize()

            parties = pparties
            tableView.scrollEnabled = parties.count > 0
        }
    }

    // MARK: CLLocationManagerDelegate
