fix template loading