update method works like this