fix concurrency logic