fixed global leaks: key

I corrected the global leak.