Tracking the last valid row