Cancel query working