Fixed Query bug