added a check for a defined  before doing a  eq command.  Avoids a warning