Added a conditional update method.