bugfix: dont go to page 1 after resizing the window.