@Override
    public void windowClosing(WindowEvent e) {
      int option = client.isUserAuthorized() ? showConfirmWarningMessage("Exit application?",
          "Are you sure you want to exit? You will be logged out!") : JOptionPane.YES_OPTION;
      if (option == JOptionPane.YES_OPTION) {
        try {
          client.stop();
        }
        catch (IOException exception) {
          // client stop failed
        }
        finally {
          conversationController.closeAllConversations();
          mainWindow.dispose();
          System.exit(0);
        }
      }
    }