fix bug with reseting next_data to zero if data not changed