     let managedContext = (UIApplication.sharedApplication().delegate as! AppDelegate).managedObjectContext!
     
     var initialAppearance = true
+    
+    var dataLoaded = false
 
     override func viewDidLoad() {
         super.viewDidLoad()


        let sampleQuery = HKSampleQuery(sampleType: HKWorkoutType.workoutType(), predicate: nil, limit: 50, sortDescriptors: [sortDescriptor])
            { (sampleQuery, results, error ) -> Void in
                
                if let queryError = error {
                    println( "There was an error while reading the samples: \(queryError.localizedDescription)")
                }

    func tableView(tableView:UITableView, numberOfRowsInSection section:Int) -> Int {
        var numRows = workouts.count
        
        if numRows == 0 && dataLoaded {
            numRows = 1
        }
        
