added template loaded events