fixes a bug when resizing the window before a window listener is set