add codes for Thread testing