Fixed issues for Thread