concurrency for writing leaves