How the gas nozzle knows when to shut off