Add tid for valid terms only