added pageswitch method