add promise in getTree