using HOSTNAME and add extract function