fix concurrency problem