uninit the modules when the template is changed