Use defined variable for getting event type