fix bug in expire/ttl handling