added pages functionality