write out proper json