fix use of deprecated function in add_resistor