Safe text replace