I created problems by trying to assemble and write pieces, while the json was being written asyncronously