This code is a bit weird. We do have a widget loading function that allows for loading a specific widget into a specific container. Perhaps that would be better?