# Problem with saving a custom UOverlay widget with default content

**URL:** <https://forums.unrealengine.com/t/problem-with-saving-a-custom-uoverlay-widget-with-default-content/329170>\
**Category:** UI\
**Tags:** overlay, unreal-engine, Widget, question, UMG\
**Created:** [August 19, 2015, 2:46am UTC](https://forums.unrealengine.com/t/problem-with-saving-a-custom-uoverlay-widget-with-default-content/329170 "2015-08-19T02:46:03Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![cridia](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/cridia/32/772487_2.png) [@cridia](https://forums.unrealengine.com/u/cridia)\
**Post date:** [August 19, 2015, 2:46am UTC](https://forums.unrealengine.com/t/problem-with-saving-a-custom-uoverlay-widget-with-default-content/329170/1 "2015-08-19T02:46:03Z")

</div>

I am currently trying to make a custom UOverlay widget with default content. The idea is essentially to make a specialized menu item that I can spawn without having to do too much work on setting each individual menu item’s unique properties. Something I can easily mass spawn into a scrollbox or something.

Based on some other information I found, I am trying to use the RebuiltWidget function, and the following code seems to do what I want:

```
TSharedRef<SWidget> UBK_UIWidget_ItemContainerSimple::RebuildWidget()
{
	TSharedRef<SWidget> ItemContainerWidget = Super::RebuildWidget();

	if (!ItemIconContainer)
	{
		ItemIconContainer = NewObject<UImage>(UImage::StaticClass());
		if (ItemIconContainer)
		{
			ItemIconContainer->Brush.ImageSize = FVector2D(64.f, 64.f);
			ItemIconSlot = AddChildToOverlay(ItemIconContainer);
		}
	}

	return ItemContainerWidget;
}

```

And the corresponding lines in the .h file:

```
	UPROPERTY()
		UImage* ItemIconContainer;

	UPROPERTY()
		UOverlaySlot* ItemIconSlot;

```

With this, it does create the UImage whenever placed (without any crashes), but when I try to save it, it cannot save the package due to the generated UImage. How can I make it so that my widget can be saved normally if I place a menu-item? I should note that at this point, I have only extended from the UMG UOverlay class; I have not yet touched any of the slate classes.

 ![54717-umgerror.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/3/b/5/3b52006dd2d8620e2615ec12f279acb9087a45d2.jpeg)
