fix extra loop