added hostname parsing