moved url change to window ready callback