fix AttributeError