Index: acidfree.module
===================================================================
--- acidfree.module	(revision 425)
+++ acidfree.module	(working copy)
@@ -1247,15 +1247,23 @@
 }
 
 function acidfree_get_album_tree(&$node, $depth=0) {
-    $tree = Array();
+    static $tree = null;
+	$mytree = array();
     if (!isset($node->nid))
-        return $tree;
-    $children = _acidfree_get_children($node, -1, 0, "class = 'album'");
-    $tree[] = $node;
-    foreach ($children as $child) {
-        $child->depth = $depth;
-        $tree = array_merge($tree, acidfree_get_album_tree($child, $depth + 1));
-    }
+        return array();
+	if ($tree == null) {
+		$children = _acidfree_get_children($node, -1, 0, "class = 'album'");
+		$mytree[] = $node;
+		foreach ($children as $child) {
+			$child->depth = $depth;
+			$mytree = array_merge($mytree, acidfree_get_album_tree($child, $depth + 1));
+		}
+		if ($depth != 0) {
+			return $mytree;
+		}
+		$tree = $mytree;
+	}
+	
     return $tree;
 }
 
