     if !preferences.chat.phrase
       preferences.chat.phrase = {}
     if !preferences.chat.max_windows
-      preferences.chat.max_windows = @maxChatWindows
+      preferences.chat.max_windows = @windowSpace.maxChatWindows
 
     App.view('customer_chat/setting')(
       chats: App.Chat.all()


  settings: (errors = {}) ->
    new Setting(
      maxChatWindows: @maxChatWindows
      errors: errors
    )


    params = @formParam(e.target)

    @formDisable(e)

    # update runtime
    @windowSpace.maxChatWindows = params.chat.max_windows

    # update user preferences
    @ajax(
