diff --git a/lib/database/domain.js b/lib/database/domain.js
index <HASH>..<HASH> 100644
--- a/lib/database/domain.js
+++ b/lib/database/domain.js
@@ -578,6 +578,7 @@ Domain.prototype = {
   },
 
   addDocumentSync: function(document) {
+    // this.storeDocument(document); => it should be another class DocumentStore implemented in database/document.js
     this.indexDocumentSync(document);
     return this;
   },
@@ -592,7 +593,7 @@ Domain.prototype = {
       }
     }, this);
 
-    grnDumpRecord = this.toGrnDumpRecord(record);
+    var grnDumpRecord = this.toGrnDumpRecord(record);
     this.context.commandSync('load', {
       table: this.tableName,
       values: JSON.stringify([grnDumpRecord])
Define variable locally (to avoid global leak)