fix queries