do not overwrite global key. instead, use privkey