made query work