Fixed a scrolling bug related to race condition