fix input closes and gadget startup