 
 	func refreshCache(for images: [Image]) -> SignalProducer<Progress, ImageServiceError> {
 		return SignalProducer { [unowned self] observer, disposable in
-			let trace = Performance.startTrace(name: "ImageService.refreshCache")
-			trace?.incrementCounter(named: "total", by: images.count)
+			self.refreshTrace = Performance.startTrace(name: "ImageService.refreshCache")
+			self.refreshTrace?.incrementCounter(named: "total", by: images.count)
 			do {
 				try self.checkCacheDirectory()
 				var currentCache: [String] = try FileManager.default.contentsOfDirectory(atPath: self.cacheDirectory.path)

						do {
							try self.store(value, for: image)
							observer.send(value: value)
							observer.sendCompleted()
						} catch let error as ImageServiceError {
							observer.send(error: error)
						} catch {}
					case let .failure(error):
						observer.send(error: ImageServiceError.FailedDownload(image: image,
																			  description: error.localizedDescription))
					}
				})
			} catch let error as ImageServiceError {


				for imageId in currentCache {
					self.clearCache(for: imageId)
					self.refreshTrace?.incrementCounter(named: "pruned")
					print("Pruned image \(imageId) from cache.")
				}
				progress.completedUnitCount += 1
