Added logic to update template slots when template is changed from the dropdown