fix append by suggestion from suhaliv

remove line root=tag[-len(root):]
this is suggested by @suhailv, I test the modification with unittest and it didn't break any test.
I think this is safe to remove.