fix getUrl from referrer
updates from sanmiks project