fixed the resize window bug