changed adding a thread to a queue