           .replace(/\/(server|shared)\//, "")
 
         @metadata().templates[index] = content.toString()
-        cb index
-
-    finder = findit dirname
-
-    # we received a file
-    finder.on "file", (file, stat) =>
-      files.push file
-
-    # we received all files.
-    finder.on "end", =>
-      async.eachSeries files,
-        readFile = (file, done) =>
-          loadTemplateFile file, (index) =>
-            done()
-
-        # we are done!
-        finished = (err) =>
-          cb()
+
+        cb err, index
+
+    async.series [
+      (cb) =>
+        finder = findit dirname
+
+        # we received a file
+        finder.on "file", (file, stat) =>
+          files.push file
+
+        # we received all files.
+        finder.on "end", cb
+
+      (cb) =>
+        async.eachSeries files, loadTemplateFile, cb
+    ], (err) =>
+      return callback err
 
     # watch for changes and automatically reload files
     if Salad.env is "development"
       gaze "#{dirname}/*/*/*.hbs", (err, watcher) =>
         watcher.on "changed", (file) =>
-          loadTemplateFile file, (index) =>
+          loadTemplateFile file, (err, index) =>
             content = @metadata().templates[index]
             Salad.Template.Handlebars.registerPartial index, content
 


    loadTemplateFile = (file, cb) =>
      fs.readFile file, (err, content) =>
        file = path.normalize(file)
        index = file
          .replace(path.normalize(dirname), "")


    cb()

  initTemplates: (callback) ->
    # find all templates and save their content in a hash
    files = []
    @metadata().templates = {}
