removing race conditions from tests