fix a bug in saving hierarchy
find and visualize the common subtree (will crash in release mode)