Minor fix on query