improved timeout logic
fixed TTL offset issue