fix hash function bug