fix some queries