fixed replace when object has children
fix for replace when target has children