fix bug and add hashtable for k/v