Fixed bug when page type template is used and pages like search is changed