fix a bug of rate calculating