fix path issue for templates
more bugs with path