Use text replace for updating line instead of creating a new line with .join