Fixed AttributeError: 'S' object has no attribute 'fields'