replacing old file with text file