diff --git a/chatdialog.cpp b/chatdialog.cpp
index 3bc518d..9fbe15e 100644
--- a/chatdialog.cpp
+++ b/chatdialog.cpp
@@ -1,6 +1,7 @@
 #include <QtGui>
 #include "chatdialog.h"
 #include <ctime>
+#include <iostream>
 
 ChatDialog::ChatDialog(QWidget *parent)
   : QDialog(parent)
@@ -8,6 +9,9 @@
   setupUi(this);
   lineEdit->setFocusPolicy(Qt::StrongFocus);
 
+  // for test only
+  m_nick = "Tester";
+  m_chatroom = "Test";
 
   connect(lineEdit, SIGNAL(returnPressed()), this, SLOT(returnPressed()));
 }
@@ -15,16 +19,27 @@
 void
 ChatDialog::appendMessage(const SyncDemo::ChatMessage &msg) 
 {
-  if (msg.from().isEmpty || message.msgData().isEmpty())
+
+  if (msg.type() != SyncDemo::ChatMessage::CHAT) {
     return;
+  }
+
+  if (!msg.has_data()) {
+    return;
+  }
+
+  if (msg.from().empty() || msg.data().empty()) {
+    return;
+  }
 
   QTextCursor cursor(textEdit->textCursor());
   cursor.movePosition(QTextCursor::End);
   QTextTableFormat tableFormat;
   tableFormat.setBorder(0);
   QTextTable *table = cursor.insertTable(1, 2, tableFormat);
-  table->cellAt(0, 0).firstCursorPosition().insertText("<" + msg.from() + ">: ");
-  table->cellAt(0, 1).firstCursorPosition().insertText(msg.msgData());
+  QString from = QString("<%1>: ").arg(msg.from().c_str());
+  table->cellAt(0, 0).firstCursorPosition().insertText(from);
+  table->cellAt(0, 1).firstCursorPosition().insertText(msg.data().c_str());
   QScrollBar *bar = textEdit->verticalScrollBar();
   bar->setValue(bar->maximum());
 }
@@ -41,6 +56,8 @@
   if (text.isEmpty())
     return;
  
+  lineEdit->clear();
+
   SyncDemo::ChatMessage msg;
   formChatMessage(text, msg);
   
@@ -48,14 +65,14 @@
   // send message
   appendMessage(msg);
   updateTreeView();
-
+  
 }
 
 void
 ChatDialog::formChatMessage(const QString &text, SyncDemo::ChatMessage &msg) {
-  msg.set_from(m_nick);
-  msg.set_to(m_chatroom);
-  msg.set_msgData(text);
+  msg.set_from(m_nick.toStdString());
+  msg.set_to(m_chatroom.toStdString());
+  msg.set_data(text.toStdString());
   time_t seconds = time(NULL);
   msg.set_timestamp(seconds);
 }
