added some code to page templates