fixed extra page issue on the templates