fix event handling of is_template (now cannot be NULL)