manage missing values in templates