added template condition