fixes event object in template always being undefined