queries bug fixed