update when method.