   func deleteRecordAtIndexPath(indexPath:NSIndexPath){
       let record = recordAtIndexPath(indexPath)
       ClockRecordService.sharedService.delete(record)
+      let records = recordsOfSection(indexPath.section)
+      if let index = records.indexOf(record){
+         recordDateRangeAtSection(indexPath.section).records.removeAtIndex(index)
+      }
       collectionView?.deleteItemsAtIndexPaths([indexPath])
       loadData()
   }

    return recordDateRanges[section]
  }
  
  func recordsOfIndexPath(section:Int) -> [ClockRecord]{
    return recordDateRangeAtSection(section).records
  }
  
  func recordAtIndexPath(indexPath:NSIndexPath) -> ClockRecord{
    let records = recordsOfIndexPath(indexPath.section)
    return records[indexPath.item]
  }
  

  }
  
  func numberOfItemsInSection(section:Int) -> Int {
    return recordsOfSection(section).count
  }
  // MARK: DataSource
  
