Finished function of getting current rate, and fix a bug of UI.