fix directive template bug