diff --git a/src/ephy-location-action.c b/src/ephy-location-action.c
index 2c1f944..136a210 100644
--- a/src/ephy-location-action.c
+++ b/src/ephy-location-action.c
@@ -97,6 +97,17 @@ destroy_match_func (gpointer data)
 	g_slice_free (LocationEntryAction, data);
 }
 
+#define MAX_MATCHES 40
+static int match_func_matches_count = 0;
+
+static void
+editable_changed_cb (GtkEditable *editable,
+		     EphyLocationEntry *entry)
+{
+	if (match_func_matches_count > MAX_MATCHES)
+		match_func_matches_count = 0;
+}
+
 static gboolean
 match_func (GtkEntryCompletion *completion,
 		const char *key,
@@ -113,6 +124,10 @@ match_func (GtkEntryCompletion *completion,
 	GtkTreeModel *model;
 	GRegex *regex;
 
+
+	if (match_func_matches_count > MAX_MATCHES)
+		return FALSE;
+
 	priv = EPHY_LOCATION_ACTION (((LocationEntryAction *) data)->action)->priv;
 
 	model = gtk_entry_completion_get_model (completion);
@@ -135,11 +150,17 @@ match_func (GtkEntryCompletion *completion,
 		|| (extra && g_regex_match (regex, extra, G_REGEX_MATCH_NOTEMPTY, NULL))
 		);
 
+	g_debug("[%d] title: %s; match_func_matches_count: %d; MAX_MATCHES: %d",
+			ret, item, match_func_matches_count, MAX_MATCHES);
+
 	g_free (item);
 	g_free (url);
 	g_free (keywords);
 	g_free (extra);
 
+	if (ret && match_func_matches_count <= MAX_MATCHES)
+		match_func_matches_count++;
+
 	return ret;
 }
 
@@ -418,6 +439,8 @@ connect_proxy (GtkAction *action, GtkWidget *proxy)
 		add_completion_actions (action, proxy);
 
 		sync_address (action, NULL, proxy);
+		g_signal_connect (lea->entry, "user_changed",
+				  G_CALLBACK (editable_changed_cb), NULL);
 		g_signal_connect_object (action, "notify::address",
 					 G_CALLBACK (sync_address), proxy, 0);
 		sync_editable (action, NULL, proxy);
