removed race condition from unit test