Add getter and setter for ttl.