fix TimeoutThread bug #21