added template refresh