fixing invalid hash reference