fix a scrolling error while resizing window