fixed template loading