replace root nodes