Add check variables in TermId

GCP-9879

Reviewer: Aldrin Batac