security updates on template functions file