         }
       case .Idle:
         reloadImageView.removeFromSuperview()
-        displayLink.paused = true
+        if let link = displayLink {
+          link.paused = true
+        }
       }
     }
   }

    return image
  }()
  
  private lazy var displayLink: CADisplayLink = {
    let link = CADisplayLink(target: self, selector: "updateUI")
    link.frameInterval = 30 // twice every second
    return link

  }
  
  deinit {
    if let link = displayLink {
      link.invalidate()
    }
  }
}

