added cap to number of events