Fix some concurrency issue