fixed a bug related to smooth scrolling.