a quick fix of query bug