Added handler to replace text with new text.