fixed template loading bug