fixed detecting hostname