Change file.puts to EOF