fixed KeyError