Fix the deletion of the pop-up on route change