fix hash table append position detection; more boundary checking in hash table