Merge "Adding logs and re-organized the logic of get root task" into tm-dev