changing page logic