fix bug when config has hostname