fix some update logic