AttributeError fix