added basic event handlers to templates