adding update method