use WriteText and WriteJson