fixed vcltemplate to handle nil director