 //                        let err = NSError(domain: "App error", code: 0, userInfo: [NSLocalizedDescriptionKey:kvdict.description])
 //                        let dict = ["title":"population data error", "error":err]
 //                        NSNotificationCenter.defaultCenter().postNotificationName("ncAppLogNotification", object: nil, userInfo: dict)
-                        break
                     }
                 }
             }
             if ( !failed ) {
                 Async.main {
-                    //addSALogObj("Setting population data", ["some key":"some value"])
-                    let dict = ["title":"population data", "obj":populationAggregates.description ?? ""]
-                    NSNotificationCenter.defaultCenter().postNotificationName("ncAppLogNotification", object: nil, userInfo: dict)
+//                    let dict = ["title":"population data", "obj":populationAggregates.description ?? ""]
+//                    NSNotificationCenter.defaultCenter().postNotificationName("ncAppLogNotification", object: nil, userInfo: dict)
                     self.mostRecentAggregates = populationAggregates
                     NSNotificationCenter.defaultCenter().postNotificationName(HMDidUpdateRecentSamplesNotification, object: self)
                 }
             }
-            else{
-                
-            }
         }
     }
 }
            }
        }
    }

    func refreshAggregatesFromMsg(payload: AnyObject?) {
        var populationAggregates : [HKSampleType: [MCSample]] = [:]
        if let aggregates = payload as? [[String: AnyObject]] {

                for (column, val) in sample {
                    log.info("Refreshing population aggregate for \(column)")
                    if let sampleValue = val as? Double,
                        typeIdentifier = HMConstants.sharedInstance.mcdbToHK[column]
                    {
                        switch typeIdentifier {
                        case HKCategoryTypeIdentifierSleepAnalysis:
                            let sampleType = HKObjectType.categoryTypeForIdentifier(HKCategoryTypeIdentifierSleepAnalysis)!
                            populationAggregates[sampleType] = [MCAggregateSample(value: sampleValue, sampleType: sampleType)]
                            
                        case HKCategoryTypeIdentifierAppleStandHour:
                            let sampleType = HKObjectType.categoryTypeForIdentifier(HKCategoryTypeIdentifierAppleStandHour)!
                            populationAggregates[sampleType] = [MCAggregateSample(value: sampleValue, sampleType: sampleType)]
                            
                        default:
                            let sampleType = HKObjectType.quantityTypeForIdentifier(typeIdentifier)!
                            populationAggregates[sampleType] = [MCAggregateSample(value: sampleValue, sampleType: sampleType)]
