fix a bug when match host name