redirect to the main page after page removing, but only if the page being removed is currently shown