fixes bug in gethostname call