Completed the update method