correct the iterations on resize