diff --git a/index.html b/index.html
index 0ec1ba98a6..fd8e6035c1 100644
--- a/index.html
+++ b/index.html
@@ -106,11 +106,9 @@ THE SOFTWARE.
if (location_hash_params.indexOf('gist') !== -1 && location_hash_params.length >= 2) {
var index = location_hash_params.indexOf('gist');
var gistId;
- var key = location_hash_params[1];
+ var key = location_hash_params[index+1];
if (key === '') {
gistId = getGistId( prompt("Enter the gist url or id you'd like to load.") );
- } else if (key === "referer") {
- gistId = getGistId( document.referer );
} else {
gistId = getGistId( key );
}