handle KeyError gracefully as advertised