loadGadget: added check to update DOM when reloading gadget