raise AttributeError than KeyError to make pickle works