fix resize window error