change to write txt file