fixed concurrency issues