As mentioned, I would have handled this outside the loop, to avoid that the most normal case (no wildcard) loops through all wells.