fixed a concurrency issue