Added replaceChildren function