Solved concurrency problem