set text file only when it exists