fix template issue with undef value