fix some query issue