Fix for"10 $digest() iterations reached" with IE9 and IE8

There was an issue with location.replace method isn't changing the location.href immediately.