FIXED : override text file after tmp file has been created