improved save portal tree, a few bugs left