delete and adding pages functional