Handle popup using back() functinoality by redirecting once the popup is closed