use the Event custom class when creating object