fix bug parsing hostname