Replace location.href with navigate