Remove the use of 'p' variable in templates