add events and update method.