add term encoder