fixed lagging when window resize