replace tree