diff --git a/chatdialog.cpp b/chatdialog.cpp
index 19ea99a..2449ed6 100644
--- a/chatdialog.cpp
+++ b/chatdialog.cpp
@@ -79,7 +79,7 @@
   createTrayIcon();
   connect(lineEdit, SIGNAL(returnPressed()), this, SLOT(returnPressed()));
   connect(setButton, SIGNAL(pressed()), this, SLOT(buttonPressed()));
-  connect(this, SIGNAL(dataReceived(QString, const char *, size_t)), this, SLOT(processData(QString, const char *, size_t)));
+  connect(this, SIGNAL(dataReceived(QString, const char *, size_t, bool)), this, SLOT(processData(QString, const char *, size_t, bool)));
   connect(this, SIGNAL(treeUpdated(const std::vector<Sync::MissingDataInfo>)), this, SLOT(processTreeUpdate(const std::vector<Sync::MissingDataInfo>)));
   connect(this, SIGNAL(removeReceived(QString)), this, SLOT(processRemove(QString)));
   connect(trayIcon, SIGNAL(messageClicked()), this, SLOT(showNormal()));
@@ -201,8 +201,9 @@
     totalMissingPackets += v[i].high.getSeq() - v[i].low.getSeq() + 1;
   }
   
-  if (totalMissingPackets < 10) {
-    for (int i = 0; i < n; i++) 
+  for (int i = 0; i < n; i++) 
+  {
+    if (totalMissingPackets < 4)
     {
       for (Sync::SeqNo seq = v[i].low; seq <= v[i].high; ++seq)
       {
@@ -212,13 +213,10 @@
 #endif
       }
     }
-  }
-  else
-  {
-    // too bad; too many missing packets
-    // we may just join a new chatroom
-    // or some network patition just healed
-    // we don't try to fetch any data in this case (for now)
+    else
+    {
+        m_sock->fetchRaw(v[i].prefix, v[i].high, bind(&ChatDialog::processDataNoShowWrapper, this, _1, _2, _3), 2);
+    }
   }
 
   // adjust the view
@@ -229,20 +227,25 @@
 void
 ChatDialog::processDataWrapper(std::string name, const char *buf, size_t len)
 {
-  emit dataReceived(name.c_str(), buf, len);
+  emit dataReceived(name.c_str(), buf, len, true);
 #ifdef __DEBUG
   std::cout <<"<<< " << name << " fetched" << std::endl;
 #endif
 }
 
 void
-ChatDialog::processData(QString name, const char *buf, size_t len)
+ChatDialog::processDataNoShowWrapper(std::string name, const char *buf, size_t len)
+{
+  emit dataReceived(name.c_str(), buf, len, false);
+}
+
+void
+ChatDialog::processData(QString name, const char *buf, size_t len, bool show)
 {
   SyncDemo::ChatMessage msg;
   if (!msg.ParseFromArray(buf, len)) 
   {
-    std::cerr << "Errrrr.. Can not parse msg at "<<__FILE__ <<":"<<__LINE__<<". what is happening?" << std::endl;
-    abort();
+    std::cerr << "Errrrr.. Can not parse msg with name: " << name.toStdString() << ". what is happening?" << std::endl;
   }
 
   // display msg received from network
@@ -250,7 +253,10 @@
   // so if we call appendMsg directly
   // Qt crash as "QObject: Cannot create children for a parent that is in a different thread"
   // the "cannonical" way to is use signal-slot
-  appendMessage(msg);
+  if (show)
+  {
+    appendMessage(msg);
+  }
   
   // update the tree view
   std::string stdStrName = name.toStdString();
