Replaced location.replace with location.href