$term is not defined