add test code for thread