adjusted how threads are launched