fix for stack overflow / access to undefined ref during `json(DataType)`