Bug with window.location fixed.