fix an error with catching thread timeouts