fixed race condition in tests