fix up conditional template rendering