fix a bug when resizing the window