modified update method