Syncronize writes to build valid json