Concurrency bug fix