correcting urlref value to use document.referrer, which is the proper way to access the referring URL.