Fix thread impl