diff --git a/camel/providers/nntp/camel-nntp-summary.c b/camel/providers/nntp/camel-nntp-summary.c
index 7984b8a..aa1ae67 100644
--- a/camel/providers/nntp/camel-nntp-summary.c
+++ b/camel/providers/nntp/camel-nntp-summary.c
@@ -265,8 +265,10 @@ add_range_xover(CamelNNTPSummary *cns, CamelNNTPStore *store, unsigned int high,
 	int len, ret;
 	unsigned int n, count, total, size;
 	struct _xover_header *xover;
+	GHashTable *summary_table;
 
 	s = (CamelFolderSummary *)cns;
+	summary_table = camel_folder_summary_get_hashtable(s);
 
 	camel_operation_start(NULL, _("%s: Scanning new messages"), ((CamelService *)store)->url->host);
 
@@ -323,7 +325,8 @@ add_range_xover(CamelNNTPSummary *cns, CamelNNTPStore *store, unsigned int high,
 
 		/* truncated line? ignore? */
 		if (xover == NULL) {
-			if (!camel_folder_summary_check_uid (s, cns->priv->uid)) {
+			//if (!camel_folder_summary_check_uid (s, cns->priv->uid)) {
+			if (!GPOINTER_TO_INT(g_hash_table_lookup (summary_table, cns->priv->uid))) {
 				mi = (CamelMessageInfoBase *)camel_folder_summary_add_from_header(s, headers);
 				if (mi) {
 					mi->size = size;
@@ -343,6 +346,8 @@ add_range_xover(CamelNNTPSummary *cns, CamelNNTPStore *store, unsigned int high,
 
 	camel_operation_end(NULL);
 
+	camel_folder_summary_free_hashtable(summary_table);
+
 	return ret;
 }
 
@@ -356,9 +361,12 @@ add_range_head(CamelNNTPSummary *cns, CamelNNTPStore *store, unsigned int high,
 	unsigned int i, n, count, total;
 	CamelMessageInfo *mi;
 	CamelMimeParser *mp;
+	GHashTable *summary_table;
 
 	s = (CamelFolderSummary *)cns;
 
+	summary_table = camel_folder_summary_get_hashtable(s);
+
 	mp = camel_mime_parser_new();
 
 	camel_operation_start(NULL, _("%s: Scanning new messages"), ((CamelService *)store)->url->host);
@@ -387,7 +395,8 @@ add_range_head(CamelNNTPSummary *cns, CamelNNTPStore *store, unsigned int high,
 		if ((msgid = strchr(line, '<')) && (line = strchr(msgid+1, '>'))){
 			line[1] = 0;
 			cns->priv->uid = g_strdup_printf("%u,%s\n", n, msgid);
-			if (!camel_folder_summary_check_uid (s, cns->priv->uid)) {
+			//if (!camel_folder_summary_check_uid (s, cns->priv->uid)) {
+			if (!GPOINTER_TO_INT(g_hash_table_lookup (summary_table, cns->priv->uid))) {
 				if (camel_mime_parser_init_with_stream(mp, (CamelStream *)store->stream) == -1)
 					goto error;
 				mi = camel_folder_summary_add_from_parser(s, mp);
@@ -425,6 +434,8 @@ ioerror:
 
 	camel_operation_end(NULL);
 
+	camel_folder_summary_free_hashtable(summary_table);
+
 	return ret;
 }
 
@@ -496,6 +507,10 @@ camel_nntp_summary_check(CamelNNTPSummary *cns, CamelNNTPStore *store, char *lin
 		cns->low = f;
 	}
 
+	camel_db_delete_uids (s->folder->parent_store->cdb_w, s->folder->full_name, del, ex);
+	g_slist_foreach (del, (GFunc) g_free, NULL);
+	g_slist_free (del);
+
 	if (cns->high < l) {
 		if (cns->high < f)
 			cns->high = f-1;
@@ -507,10 +522,6 @@ camel_nntp_summary_check(CamelNNTPSummary *cns, CamelNNTPStore *store, char *lin
 		}
 	}
 
-	camel_db_delete_uids (s->folder->parent_store->cdb_w, s->folder->full_name, del, ex);
-	g_slist_foreach (del, (GFunc) g_free, NULL);
-	g_slist_free (del);
-
 	/* TODO: not from here */
 	camel_folder_summary_touch(s);
 	camel_folder_summary_save_to_db (s, ex);
diff --git a/camel/providers/nntp/camel-nntp-utils.c b/camel/providers/nntp/camel-nntp-utils.c
index 13585b5..1815bb0 100644
--- a/camel/providers/nntp/camel-nntp-utils.c
+++ b/camel/providers/nntp/camel-nntp-utils.c
@@ -266,14 +266,23 @@ camel_nntp_get_headers (CamelStore *store,
 
 	i = camel_folder_summary_count(folder->summary);
 	if(i != 0) {
+		GList *del = NULL;
 		last_summary = uid_num(folder->summary, i-1);
 
 		if(last_summary < first_message)
 			camel_folder_summary_clear(folder->summary);
 		else {
-			while(uid_num(folder->summary, 0) < first_message) 
-				camel_folder_summary_remove_index(folder->summary, 0);
-			
+ 			while(uid_num(folder->summary, 0) < first_message) {
+ 				char *uid = camel_folder_summary_uid_from_index (folder->summary, 0);
+ 				del = g_slist_prepend (del, uid);
+ 				camel_folder_summary_remove_index_fast (s, 0);
+ 				//camel_folder_summary_remove_index(folder->summary, 0);
+ 			}
+  
+ 			camel_db_delete_uids (folder->parent_store->cdb_w, folder->full_name, del, ex);
+ 			g_slist_foreach (del, (GFunc) g_free, NULL);
+ 			g_slist_free (del);
+ 						
 			if(last_summary >= last_message)
 				return;
 			
