fixed concurrency problem in tests