Fixed concurrency bug