handle tempaltes with subdir