fix for resizing window