change to catch KeyError