Modified some update code