fixed the querry