Escape strings before appending them to json