adding template files to the list when its tab is selected