added folding for json builder