fix hostname setting bug