update rooting function