before changing the main template