Fixed an issue where the template may not be reset