fix bug in setting hostname