changed base class of entity to event emitter