fix bug with ttl