stack is too small to hold a tree, now support permuterm tree