handling the inverter