fixed wrong query