use khash instead of glib