diff --git a/demo/editor.html b/demo/editor.html
index adeb605c..f0d054af 100644
--- a/demo/editor.html
+++ b/demo/editor.html
@@ -255,7 +255,7 @@ ace.addListener(container, "drop", function(e) {
editor.onTextInput(reader.result);
modeEl.value = mode;
- editor.setMode(modes[mode]);
+ editor.getDocument().setMode(modes[mode]);
}
reader.readAsText(file);
}