fix bug in escape_hostname