updated checking for dotfiles in templates directory