fixed concurrency issue in unit tests