fix a bug on canScroll method