a query bug fixed