Change window.location when window.open returns 'null'