fix PHP warning in template