add events and base class.