Fix wrong query