use global hash reference correctly