fixed race condition in UT