fixed concurrency bug