fix query condition