fix test case for multiple threads