Isn't the resource currentKey leaked here, when it overrides the key from line 244?