Added add page and edit page functions