#122 fixed bug in asynchronus writing, implemented a task queue (default maxConcurrentTasks = 10)