trying to fix bug with concurrency