setting up pages and toggle