Fix root
referenced before assignment
#4920
Merged
root
referenced before assignment
#4920