Changed redirect method from location.href to location.replace

As per: http://stackoverflow.com/a/506004/1781435