fixing a logic error in populating /etc/hostname