multiple query beug fixing