     }
     
     func next(sender: UIButton?) {
-        var backButton = viewWithTag(5) as UIButton
-        backButton.enabled = true
+        if let view = viewWithTag(5) {
+            var backButton = view as UIButton
+            backButton.enabled = true
+        }
         
-        var nextButton = viewWithTag(6) as UIButton
-        nextButton.enabled = false
+        if let view = viewWithTag(6) {
+            var nextButton = view as UIButton
+            nextButton.enabled = false
+        }
         
         var graph = viewWithTag(2) as BEMSimpleLineGraphView
         graph.hidden = true
         
-        var rankingTable = viewWithTag(7) as RankingView
-        rankingTable.hidden = false
+        if let view = viewWithTag(7) {
+            var rankingTable = view as RankingView
+            rankingTable.hidden = false
+        }
         
         if let result = result {
             result.focusOnGraph = false

        
        if let result = result {
            var graph = viewWithTag(2) as BEMSimpleLineGraphView
            graph.enablePopUpReport = true
            graph.colorBackgroundXaxis = UIColor.whiteColor()
            graph.colorTop = UIColor.clearColor()
            graph.colorBottom = UIColor.whiteColor().colorWithAlphaComponent(0.2)
            graph.colorLine = UIColor.whiteColor()
            graph.delegate = result
            graph.dataSource = result
            if !animated {
                graph.animationGraphStyle = BEMLineAnimation.None
            }
            graph.reloadGraph()
            addSubview(graph)
            
            if let view = viewWithTag(7) {
                var rankingTable = view as RankingView

    }
    
    func reload(#animated: Bool) {
        for sublayer in layer.sublayers {
            if sublayer is CAGradientLayer {
                sublayer.removeFromSuperlayer()
            }
        }
        
        var gradient = CAGradientLayer()
        gradient!.frame = self.bounds
        
        var gradientColor = UIColor.twinkrunLightBlack()
        if let result = result {
            let rank = result.rank(result.player)
            if rank == 0 {
                gradientColor = UIColor.twinkrunGreen()
            } else if rank == result.others.count {
                gradientColor = UIColor.twinkrunRed()
            }
        }
        
        gradient!.colors = [
            UIColor.clearColor(),
            gradientColor.CGColor
        ]
        layer.insertSublayer(gradient!, atIndex: 0)
        layer.cornerRadius = 4
