adding main and tree root init-cleanup