added gadget installation logic