fix no-clean-template-directory bug