possible to serialize as json when writing files