fixing window resizing issues