add multithread support for test