add page adding function. Bug - all pages are being placed under the same parent page.