fix template loading issue