Fix a bug with returning to previous page.