added isInstanced method to detect whether a widget is instanced