added a thread controller