Added the ability to set type of events