updated json dumping (needs writing permission)