Now compiling template after click. Also compatible with most browsers