bug fix in getVoltage()