added get hostname function