fixes race condition in tests