fix template compiling error