rearrange write_child()