making concurrency safe