diff --git a/ckanext/odsh/logic/action.py b/ckanext/odsh/logic/action.py
index 72994f266b8f891986a43131b0bb2b77dac2e917..10535d7fe30e7806eb5319ad90dc9ad57d4966d8 100644
--- a/ckanext/odsh/logic/action.py
+++ b/ckanext/odsh/logic/action.py
@@ -39,9 +39,9 @@ def odsh_user_create(context, data_dict):
     return model_dictize.user_dictize(model.User.get(user.get('name')), context)
 
 
-def autocomplete(self, q):
+def autocomplete(context, data_dict):
     query = {
-        'spellcheck.q': q,
+        'spellcheck.q': data_dict['q'],
         'wt': 'json'}
 
     conn = make_connection(decode_dates=False)