Fixing 'key' out of scope, @gilly3