fix resize glitch