Fix transitioning between pages