       playgrounds : @playgroundsManifest
 
   mergePlaygroundOptions: (manifest, playground) ->
-    {rawOptions}                    = @teamwork
+    rawOptions                      = @getTeamworkOptions()
     {name}                          = manifest
     firstPanel                      = rawOptions.panels.first
     firstPanel.title                = name


    super options, data

    @createTeamwork()

    if options.playground
      @doCurlRequest playgroundsManifest, (err, manifests) =>
        for manifest in manifests when manifest.name is options.playground
          url = manifest.manifestUrl
        @handlePlaygroundSelection options.playground, url
    else
      @teamwork.on "PanelCreated", =>
        @doCurlRequest playgroundsManifest, (err, manifest) =>
          @playgroundsManifest = manifest
          @dashboard = new TeamworkDashboard
            delegate : this
          @teamwork.addSubView @dashboard, null, yes

  createTeamwork: ->
    options               = @getOptions()
    instanceName          = if location.hostname is "localhost" then "teamwork-local" else "kd-prod-1"
    @teamwork             = new TeamworkWorkspace
      name                : options.name                or "Teamwork"
      joinModalTitle      : options.joinModalTitle      or "Join a coding session"
      joinModalContent    : options.joinModalContent    or "<p>Paste the session key that you received and start coding together.</p>"

        {manifestUrl} = manifest

    @doCurlRequest manifestUrl, (err, manifest) =>
      @teamwork?.destroy()
      @createTeamwork @mergePlaygroundOptions manifest, playground
      @appView.addSubView @teamwork
      @teamwork.container.setClass playground
      @teamwork.on "WorkspaceSyncedWithRemote", =>
        {contentDetails} = @teamwork.getOptions()
