improved initialization of eventsVector and tasksVector