diff --git a/lib/Models/getAncestors.js b/lib/Models/getAncestors.js
index <HASH>..<HASH> 100644
--- a/lib/Models/getAncestors.js
+++ b/lib/Models/getAncestors.js
@@ -10,10 +10,13 @@ var defined = require('terriajs-cesium/Source/Core/defined');
  * @return {CatalogMember[]} The members' ancestors in its parent tree, starting at the top, not including this member.
  */
 function getAncestors(member) {
-    if (defined(member.parent) && defined(member.parent.parent)) {
-        return getAncestors(member.parent).concat([member.parent]);
+	var parent = member.parent;
+	var ancestors = [];
+    while (defined(parent) && defined(parent.parent)) {
+        ancestors = [parent].concat(ancestors);
+        parent = parent.parent;
     }
-    return [];
+    return ancestors;
 }
 
 module.exports = getAncestors;
replace recursive getAncestors with loop