diff --git a/lib/modelExtends.js b/lib/modelExtends.js
index <HASH>..<HASH> 100644
--- a/lib/modelExtends.js
+++ b/lib/modelExtends.js
@@ -93,7 +93,7 @@ module.exports = function(Sequelize) {
 		rebuildHierarchy: function() {
 			var model = this,
 				hierarchy = this.hierarchy,
-				primaryKey = model.primaryKeyAttribute,
+				primaryKey = this.primaryKeyAttribute,
 				foreignKey = hierarchy.foreignKey,
 				throughKey = hierarchy.throughKey,
 				throughForeignKey = hierarchy.throughForeignKey,
@@ -101,7 +101,8 @@ module.exports = function(Sequelize) {
 				through = hierarchy.through;
 			
 			// truncate hierarchy through table
-			return through.destroy({}, {truncate: true}).then(function() {
+			return through.destroy({}, {truncate: true})
+			.then(function() {
 				// go up tree level by level and set hierarchy level field + create hierarchy through table records
 				var updateAttr = {};
 				updateAttr[levelFieldName] = 0;
@@ -147,7 +148,9 @@ module.exports = function(Sequelize) {
 						});
 					});
 				})();
-			});
+			})
+			// return this for chaining
+			.return(this);
 		}
 	};
Chaining on rebuildHierarchy