fixed undefined hostname treatment