Check existingId before terminating the session