add test case for race condition