add free_hash_map to release the memory occupied by hash map