Fix matching values by query