diff --git a/plugins/vala-pack/ide-vala-index.vala b/plugins/vala-pack/ide-vala-index.vala
index 97c242e..d6853f9 100644
--- a/plugins/vala-pack/ide-vala-index.vala
+++ b/plugins/vala-pack/ide-vala-index.vala
@@ -125,7 +125,7 @@ namespace Ide
 			this.source_files [file] = source_file;
 		}
 
-		public void add_files (ArrayList<GLib.File> files,
+		public async void add_files (ArrayList<GLib.File> files,
 		                             GLib.Cancellable? cancellable)
 		{
 			Ide.ThreadPool.push (Ide.ThreadPoolKind.COMPILER, () => {
@@ -134,13 +134,15 @@ namespace Ide
 					foreach (var file in files)
 						this.add_file (file);
 					Vala.CodeContext.pop ();
+					GLib.Idle.add(add_files.callback);
 				}
 			});
+
+			yield;
 		}
 
 		void load_build_flags (string[] flags)
 		{
-				GLib.message ("Loading build flags");
 			var len = GLib.strv_length (flags);
 
 			lock (this.code_context) {
@@ -203,7 +205,6 @@ namespace Ide
 
 			try {
 				var flags = yield build_system.get_build_flags_async (ifile, cancellable);
-				GLib.message ("Before load flags");
 				load_build_flags (flags);
 			} catch (GLib.Error err) {
 				warning ("%s", err.message);
@@ -396,7 +397,7 @@ namespace Ide
 					Vala.CodeContext.pop ();
 				}
 
-				GLib.Idle.add(this.find_symbol_at.callback);
+				this.find_symbol_at.callback ();
 			});
 
 			yield;
diff --git a/plugins/vala-pack/ide-vala-service.vala b/plugins/vala-pack/ide-vala-service.vala
index 8e7d360..51c7d56 100644
--- a/plugins/vala-pack/ide-vala-service.vala
+++ b/plugins/vala-pack/ide-vala-service.vala
@@ -47,7 +47,9 @@ namespace Ide
 				load_directory (vcs.get_working_directory (), null, files);
 
 				if (files.size > 0) {
-					this._index.add_files (files, null);
+					this._index.add_files.begin (files, null, () => {
+						debug ("Vala files registered");
+					});
 				}
 			});
 		}
