fix hash inversion problem