Added env variable HOSTNAME handling