query bug