add SetRates function and related fix