Changed thread to _thread