updated writing json