Thanks Pawel.  I've removed @term as $term can't be defined at this point.