Some changes for resizing window