add page loading to template