added txt extension to write file