fixed bad queries