added write to json