Add templates_loaded event