--- remove-duplicates-plugin-0.0.4.orig/src/remove-duplicates.c 
+++ remove-duplicates-plugin-0.0.4/src/remove-duplicates.c 
@@ -172,14 +172,21 @@
 	GPtrArray *selected;
 
 	shell_content = e_shell_view_get_shell_content (shell_view);
-
 	reader = (EMailReader *) (shell_content);
 	message_list = e_mail_reader_get_message_list (reader);
+
+        if (message_list->threaded) {
+                message_list_set_threaded_expand_all (message_list);
+	} 
+	message_list_select_all (message_list);
+
 	selected = message_list_get_selected (message_list);
-
 	handle_messages (message_list->folder, selected);
-
 	message_list_free_uids (message_list, selected);
+
+	/* unselect the mesages */
+	message_list_invert_selection (message_list);
+
 }
 
 static GtkActionEntry entries[] = {
