add to_hash in native.c