diff --git a/searx/webapp.py b/searx/webapp.py
index 46d4e949c..2ba8ccfb8 100755
--- a/searx/webapp.py
+++ b/searx/webapp.py
@@ -425,6 +425,7 @@ def render(template_name, override_theme=None, **kwargs):
kwargs['brand'] = brand
kwargs['scripts'] = set()
+ kwargs['endpoint'] = 'results' if 'q' in kwargs else request.endpoint
for plugin in request.user_plugins:
for script in plugin.js_dependencies:
kwargs['scripts'].add(script)