fixed issue with wrong bad, revamped update root function