Fixing $page->pdo in templates