added KeyError exceptions