rewrote add_page - check that the same page is not added twice