     }
     
     func updateViews() {
-        if playlist == nil {
-            return
-        }
-        let currentPlaylist = self.playlist!
-        if currentIndex >= 0 && currentIndex < currentPlaylist.tracks.count {
-            let track = currentPlaylist.tracks[currentIndex]
+        if let track = currentTrack {
             let playingInfoCenter: AnyClass? = NSClassFromString("MPNowPlayingInfoCenter")
             if let center: AnyClass = playingInfoCenter {
-                var info:[String:AnyObject]       = [:]
-                info[MPMediaItemPropertyTitle] = track.title
+                var info:[String:AnyObject]                           = [:]
+                info[MPMediaItemPropertyTitle]                        = track.title
                 MPNowPlayingInfoCenter.defaultCenter().nowPlayingInfo = info
             }
             self.miniPlayerView.titleLabel.text    = track.title

                }
            })
        } else {
            self.miniPlayerView.titleLabel.text    = "..."
            self.miniPlayerView.durationLabel.text = "--:--"
            self.miniPlayerView.thumbImgView.sd_setImageWithURL(nil)
        }
    }

            return playlist
        }
    }

    var currentTrack: Track? {
        get {
            return playlist?.tracks[currentIndex]
        }
    }
    
    @IBOutlet weak var mainViewContainer: UIView!
    var playButton:     UIButton!
