The invention relates to an apparatus and a method for the production offoods, in particular, astuffing machine for the production of sausages, with a load circuit thatgenerates a leakagecurrent IA and with a filter, a frequency converter, a motor cable and amotor. The apparatuscomprises a leakage current compensator with a device for detecting a leakagecurrent and adevice for generating a compensation current that is directed opposite to theleakage current andis superimposed with the leakage current, such that the leakage current isreduced, is in particularsubstantially eliminated.