write changes back to json