Added events into templates