Fix a bug: query error