add tree-stack compatibility