resolving a concurrency problem