adding debugging to template