Fix concurrency issues;