Fix for AttributeError