updated thread worker