typo: without the else, the exception is always thrown even when the attribute is handled