Fix wrong query call