query is getting passed into response function