Revert "Revert "Updated but still getting a KeyError.""

This reverts commit 5ca720c97c75e5b5e7e536dbd63005cd4a1d7a8b.