Fix addEventMember function