fix so that pdf template is selected correctly