moving the page change to the default function