Fixed the resizing of the window