Keyerror resolved for confidence.

Please check if the answer is correct though. I am unsure.