add query to context