fixed bug in finding hostname