corrected data flow