Fix thread restart code
Change Thread control