removes a thread