adding and showing pages dynamically