Add better exception message for widget.parent != null