updated i to i-1 in delete ttl and ttr