 
     /// Perform tasks after client connects to the server.
     func clientConnected() {
-        enableControls(true)
+        DispatchQueue.main.async {
+            self.enableControls(true)
+        }
         appDelegate?.statusItem.button?.appearsDisabled = false
     }
 


    /// Updates user interface when MPD state or current track changes.
    func updatePlayerStatus() {
        changeImageAssets()

        // Populate current track details in the user interface.
        var trackArtist: String = ""
        var trackCover: NSImage? = nil
        var trackTitle: String = "kmbmpdc"

            trackCover = currentTrack.coverArt
            trackTitle = currentTrack.name
        }

        DispatchQueue.main.async {
            self.changeImageAssets()
            self.currentTrackArtist.stringValue = trackArtist
            self.currentTrackTitle.stringValue = trackTitle
            self.setCover(trackCover)
