buffer: store key in extern var