added hostname detection