Maximize won't work after resizing the window