update data loop