Resolved some concurrency issues