Hashtable erase function not working

Why is the erase function not working for the given code?


It works when called for the first time only.The second time it does not work.Please provide the corrected code.

@Codarikh
I have answered your query in the other thread. Please do not ask the same doubt over different threads as it makes it difficult for us to follow up.