Created an update method