Replace window.location.href to .path() to change path for routing