fix the KeyError from the previous commit