some changes to thread