fix the updating bug