fixed race condition in test