Updated widget code for max num events