add thread definition