figured out the saving of the lowest level hierarchy to the local sql db