fix bug on vertical scrolling.