global leak 'lastKey' fix