added an update method