query bug fixxed