Fix for resizing windows