fixing resizeWindow()