hashing loop bug fix