fix wrong data iteration